-
Notifications
You must be signed in to change notification settings - Fork 178
Add convenience constructors to JSONRPCRequest #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
need to rebase and run apiDump again |
36a0d0e to
8909dee
Compare
878d595 to
9e78bda
Compare
tiginamaria
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nicer now! Thank you!
|
set to draft to avoid conflicts with @devcrocod's changes |
…t-constructors # Conflicts: # kotlin-sdk-client/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/client/StreamableHttpClientTransportTest.kt # kotlin-sdk-core/api/kotlin-sdk-core.api # kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types.kt
- Updated `JSONRPCRequest` with new string and numeric ID constructors. - Replaced atomic ID handling with UUID defaults. - Enhanced test coverage for JSONRPCRequest creation scenarios.
devcrocod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The request id is used to store handlers, and it’s also used as a progress token. Are you sure this change won’t break tracking of previous requests or progress notifications?
|
I am worrying that it is much harder to guarantee uniqueness of numeric field. UUID is a proven solution for such cases and migrating to UUID should be safe. Even more, we should switch from String to UUID internally to guarantee ID uniqueness. |
No, we can receive and process ids from various servers and clients (not only ours) |
kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/jsonRpc.kt
Show resolved
Hide resolved
devcrocod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Motivation and Context
To create request objects more easily
How Has This Been Tested?
Unit tests
Breaking Changes
No, this is a new API
Types of changes
Checklist
Additional context